<template>
    <el-container>
        <el-aside width="260px">

            <router-link to="/home/users">users</router-link>

        </el-aside>
        <el-container>
            <el-header>Header={{ user.username }}</el-header>
            <el-main>
                <router-view></router-view>
            </el-main>
        </el-container>
    </el-container>
</template>

<script>
import api from "@/api"
export default {
    data() {
        return {
            user: {},
            menu:[]
        }
    },
    methods: {
        async initLeftMenu() {
            let data = await api.getLeftMenu();
            console.log(data);
            this.menu = data;
        }
    },
    created(){
        this.user = JSON.parse(sessionStorage.getItem("user"))
        this.initLeftMenu();
    }
}
</script>

<style lang="scss" scoped>
.el-container{
    height: 100%;
}
.el-aside{
    background-color: $bgc;
}
.el-header{
    background-color: $white;
    box-shadow: 0 0 10px $bgc;
}
</style>